/*
 * @Author: your name
 * @Date: 2021-06-18 17:37:59
 * @LastEditTime: 2021-06-26 16:52:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \totiao\src\api\userApi.js
 */

// 用户相关的api接口
import request from '../utils/request'

// 登录的api接口
export const loginAPI = function (obj) {
  return request.post('/v1_0/authorizations', obj)
}

// 请求用户基本信息的api
export const getUserInfoApi = function () {
  return request.get('/v1_0/user')
}

// 请求用户的简介信息
export const getUserProfileApi = function () {
  return request.get('/v1_0/user/profile')
}

// 请求修改用户简介
// data的格式为{name:'xxx'} 或  {birthday: '2012-12-12'}
export const updataUserProfile = function (data) {
  return request.patch('/v1_0/user/profile', data)
}

// 请求修改用户的头像
// 形参中的fd 必须是formdata格式的请求体
export const Modifyavatar = function (fd) {
  return request.patch('/v1_0/user/photo', fd)
}
